package com.logicwin.RobotTravel.Screens;


import com.logicwin.RobotTravel.R;
import com.logicwin.RobotTravel.utils.ConfigUtils;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class FullImageView extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.full_image_view);

		// set changable view
		ImageView imageView = (ImageView) this.findViewById(R.id.viewimage);

		Intent intent = this.getIntent();
		String sceen = intent.getExtras().getString("sceen");
		int position = intent.getExtras().getInt("position");
		//Bitmap bm = (Bitmap)intent.getExtras().getParcelable("bitmap");
		
		 Resources res = this.getResources();
		 //Drawable d = res.getDrawable(ConfigUtils.getPicsDrawable(sceen, position));
		 imageView.setImageDrawable(res.getDrawable(ConfigUtils.getPicsDrawable(sceen, position)));
		/*BitmapDrawable bd = (BitmapDrawable) d;
		Bitmap bm = bd.getBitmap();
		imageView.setImageBitmap(bm);*/
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
	        // click screen
	        case MotionEvent.ACTION_DOWN:
	        	finish();
	            break;
	        case MotionEvent.ACTION_UP:
	        	break;
        }
        
        return true;
	}
	
	
}
